package daoClasses;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import connection.DBConnection;

import beanClasses.IndividualUser;

public class InsertIUDao 
{
	Query q=new Query();
	Connection con = null;
	public String InsertIndividualUser(IndividualUser IUbean)
	{	  
	    PreparedStatement pstmt = null;
	    try
	    {
	    	con = DBConnection.createConnection();
	    	pstmt = con.prepareStatement(q.insertIU(IUbean));
		
		pstmt.setString(1,IUbean.getF_name());
		pstmt.setString(2,IUbean.getM_name());
		pstmt.setString(3,IUbean.getL_name());
		pstmt.setString(4,IUbean.getDob());
		pstmt.setString(5,IUbean.getIndian_citizen());
		pstmt.setString(6,IUbean.getAddress());
		pstmt.setInt(7,IUbean.getPhn());
		pstmt.setString(8,IUbean.getEmail());
		pstmt.setString(9,IUbean.getPan());
		pstmt.setString(10,IUbean.getDemat());
		pstmt.setString(11,IUbean.getPwd());
		pstmt.setString(12,"NULL");
		pstmt.setString(13,"NULL");
		pstmt.executeUpdate();
		con.close();
		 return "SUCCESS";// execute insert statement
		} catch (Exception e) 
	    {
	    			e.printStackTrace();
	    }
		return "Invalid";
	}
}
